<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	
	<xsl:include href="main.xsl"/>

	<!--
	additional scripts
	-->
	<xsl:template mode="script" match="/">
		<script type="text/javascript" language="JavaScript">
                    function viewStatistics(xml, panel){
                        var chart = new FusionCharts("../../FusionCharts/FCF_Pie3D.swf", "ChartId", "500", "250");
                        chart.setDataXML(xml);		   
                        chart.render(panel);
                    }
		</script>
                <script type="text/javascript" src="{/root/gui/url}/scripts/gn_search.js?"/>

	</xsl:template>
	
	<!--
	page content
	-->
	<xsl:template name="content">
		<xsl:call-template name="formLayout">
			<xsl:with-param name="title" select="/root/gui/strings/statistics"/>
			<xsl:with-param name="content">
				<xsl:call-template name="form"/>
			</xsl:with-param>
			 <xsl:with-param name="menu">search</xsl:with-param>
                         <!--
			<xsl:with-param name="buttons">
				<button class="content" onclick="load('{/root/gui/locService}/admin')"><xsl:value-of select="/root/gui/strings/back"/></button>
			</xsl:with-param>
                        -->
		</xsl:call-template>
	</xsl:template>
	
	<!--
	form
	-->
        
	<xsl:template name="form">
		<xsl:variable name="lang" select="/root/gui/language"/>

                <button style="visibility: hidden" id="button1" onclick="viewStatistics('{root/response/stat1}','stat1div')"/>
                <button style="visibility: hidden" id="button2" onclick="viewStatistics('{root/response/stat2}','stat2div')"/>
                <button style="visibility: hidden" id="button3" onclick="viewStatistics('{root/response/stat3}','stat3div')"/>
                <span class="titulo"><xsl:value-of select="/root/gui/strings/metadatabyuser"/></span>
                <div id="stat1div"/>
                <br/>
                <br/>
                <span class="titulo"><xsl:value-of select="/root/gui/strings/metadatabycategories"/></span>
                <div id="stat2div"/>
                <br/>
                <br/>
                <span class="titulo"><xsl:value-of select="/root/gui/strings/metadatabyharvest"/></span>
                <div id="stat3div"/>
                <script>
                    document.getElementById('button1').onclick();
                    document.getElementById('button2').onclick();
                    document.getElementById('button3').onclick();
                </script>
                
	</xsl:template>
	
</xsl:stylesheet>
